home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / inter36c.zip / CMOS.LST < prev    next >
File List  |  1993-07-23  |  18KB  |  458 lines

  1.                     CMOS Memory Map v1.15
  2.  
  3. Compiled from multiple sources by Padgett Peterson
  4. Corrections/additions/comments to: padgett@tccslr.dnet.mmc.com
  5.  
  6. No guarantees of any kind.
  7.  
  8. Copyrights/Trademarks belong to whoever they may belong to.
  9.  
  10. The CMOS (complementary metal oxide semiconductor) memory is actually 
  11. a 64 or 128 byte battery-backed RAM memory module that is a part of the 
  12. system clock chip. Some IBM PS/2 models have the capability for a
  13. 2k (2048 byte) CMOS ROM Extension.
  14.  
  15. First used with clock-calender cards for the IBM PC-XT, when the PC/AT
  16. (Advanced Technology) was introduced in 1985, the Motorola MC146818 
  17. was a part of the motherboard. Since the clock only uses fourteen of 
  18. the RAM bytes, the rest are available for storing system configuration data. 
  19.  
  20. Interestingly, the original IBM-PC/AT standard for the region 10h-3Fh
  21. is nearly universal with one notable exception: The IBM PS/2 systems
  22. deviate considerably (AMSTRAD 8086 machines were among the first to 
  23. actively use the CMOS memory available).
  24.  
  25. This is just another example of how IBM created a standard, lost control 
  26. of it, tried to replace it, and lost market share in the process. 
  27.  
  28. Originally, the IBM PC/AT only made use of a small portion of CMOS memory
  29. and was defined in the IBM PC/AT Technical Reference Manual, specifically 
  30. bytes 10h, 12h, 14h-18h, 2Eh-33h. The balance was left undefined but was 
  31. quickly appropriated by various BIOS manufacturers for such user-selectable 
  32. options such as wait states, clock speeds, initial boot drive selection, and 
  33. password storage.
  34.  
  35. Later, as CMOS memory requirements grew, newer clock chips with 128
  36. bytes of RAM came into use. However once the AT standard was established,
  37. only IBM has tried to change the definitions of that first definition.
  38.  
  39. The CMOS memory exists outside of the normal address space and cannot
  40. contain directly executable code. It is reachable through IN and OUT
  41. commands at port number 70h (112d) and 71h (113d). To read a CMOS byte,
  42. an OUT to port 70h is executed with the address of the byte to be read and
  43. an IN from port 71h will then retrieve the requested information. The 
  44. following BASIC fragment will read 128 CMOS bytes and print them to the 
  45. screen in 8 rows of 16 values.
  46.  
  47. Note that if the CMOS only has 64 bytes available, addressing will wrap and
  48. addresses from 40h-7Fh will mirror 00h-3Fh. Output will be hexadecimal.
  49.  
  50. 10 CLS
  51. 20 FOR i = 0 TO &H7F 
  52. 30 OUT &H70, i
  53. 40 PRINT USING "\   \"; HEX$(INP(&H71));
  54. 50 NEXT i
  55. 60 PRINT " " 
  56.  
  57. 00h-0Eh is defined by the clock hardware and all must follow it. Other 
  58. manufacturers generally follow the same format as specified for the
  59. region 10h - 2Fh. Some also follow the IBM format for 30h-33h but not all 
  60. (Zenith in particular is different).
  61.  
  62. The first fourteen bytes are dedicated to the MC146818 chip clock functions 
  63. and consist of ten read/write data registers and four status registers, two 
  64. of which are read/write and two of which are read only.
  65.  
  66. Note: where not otherwise noted, all data points are expressed as BYTES
  67.  
  68. The format of the ten clock data registers (bytes 00h-09h) is:
  69.  
  70.  00h Seconds       (BCD 00-59, Hex 00-3B) Note: Bit 7 is read only      
  71.  01h Second Alarm  (BCD 00-59, Hex 00-3B)      
  72.  02h Minutes       (BCD 00-59, Hex 00-3B))         
  73.  03h Minute Alarm  (BCD 00-59, Hex 00-3B)       
  74.  04h Hours         (BCD 00-23, Hex 00-17 if 24 hr mode)
  75.                    (BCD 01-12, Hex 01-0C if 12 hr am)
  76.                    (BCD 81-92. Hex 81-8C if 12 hr pm)         
  77.  05h Hour Alarm    (same as hours)     
  78.  06h Day of Week   (01-07 Sunday=1)    
  79.  07h Date of Month (BCD 01-31, Hex 01-1F)    
  80.  08h Month         (BCD 01-12, Hex 01-0C)         
  81.  09h Year          (BCD 00-99, Hex 00-63)         
  82.  
  83. BCD/Hex selection depends on Bit 2 of register B (0Bh)
  84. 12/24 Hr selection depends on Bit 1 of register B (0Bh)
  85. Alarm will trigger when contents of all three Alarm byte registers
  86. match their companions.
  87.  
  88. The following is the on-chip status register information. 
  89.  
  90.  0Ah Status Register A (read/write) (usu 26h)
  91.   Bit 7     - (1) time update cycle in progress, data ouputs undefined 
  92.               (bit 7 is read only)
  93.   Bit 6,5,4 - 22 stage divider. 010b - 32.768 Khz time base (default)
  94.   Bit 3-0   - Rate selection bits for interrupt.
  95.               0000b - none
  96.               0011b - 122 microseconds (minimum)
  97.               1111b - 500 milliseconds  
  98.               0110b - 976.562 microseconds (default)
  99.  
  100.  0Bh Status Register B (read/write) 
  101.   Bit 7 - 1 enables cycle update, 0 disables
  102.   Bit 6 - 1 enables periodic interrupt
  103.   Bit 5 - 1 enables alarm interrupt
  104.   Bit 4 - 1 enables update-ended interrupt
  105.   Bit 3 - 1 enables square wave output
  106.   Bit 2 - Data Mode - 0: BCD, 1: Binary
  107.   Bit 1 - 24/12 hour selection - 1 enables 24 hour mode
  108.   Bit 0 - Daylight Savings Enable - 1 enables
  109.  
  110.  0Ch Status Register C (Read only)
  111.   Bit 7 - Interrupt request flag - 1 when any or all of bits 6-4 are
  112.           1 and appropriate enables (Register B) are set to 1. Generates
  113.           IRQ 8 when triggered.
  114.   Bit 6 - Periodic Interrupt flag
  115.   Bit 5 - Alarm Interrupt flag 
  116.   Bit 4 - Update-Ended Interrupt Flag
  117.   Bit 3-0 ???
  118.  
  119.  0Dh Status Register D (read only)
  120.   Bit 7 - Valid RAM - 1 indicates batery power good, 0 if dead or
  121.           disconnected.
  122.   Bit 6-0 ???
  123.  
  124. The last two bytes in the first hexadecimal decade (hexade ?) were not 
  125. specified in the PC/AT but may have the following use on some systems:
  126.  
  127.  0Eh (PS/2) Diagnostic Status Byte 
  128.      Bit 7 - When set (1) indicates clock has lost power
  129.      Bit 6 - (1) indicates incorrect checksum
  130.      Bit 5 - (1) indicates that equipment configuration is incorrect
  131.                  power-on check requires that atleast one floppy be installed
  132.      Bit 4 - (1) indicates error in memory size
  133.      Bit 3 - (1) indicates that controller or disk drive failed initialization
  134.      Bit 2 - (1) indicates that time is invalid
  135.      Bit 1 - (1) indicates installed adaptors do not match configuration
  136.      Bit 0 - (1) indicates a time-out while reading adaptor ID
  137.  
  138.  0Eh (AMSTRAD) 6  BYTEs time and date machine last used
  139.  
  140.  0Fh Reset Code        
  141.      (IBM PS/2 "Shutdown Status Byte")
  142.  
  143. The second group of values extends from address 10h to 2Dh. The word at
  144. 2Eh-2Fh is a byte-wise summation of the values in these bytes. Most BIOSes
  145. will generate a CMOS Checksum error if this value is invalid however many 
  146. programs ignore the checksum and report the apparent value. The current
  147. version of MSD reports my XT as having 20+ MB of extended memory. 
  148.  
  149. Where a definiton appears universal, no identification is made. Where
  150. the definition is thought to be specific to a manufacturer/model (AMI, 
  151. AMSTRAD, IBM AT, IBM PS/2) the identification is enclosed in parens. The
  152. AMSTAD definitions appear to relate to 8088/8086 (PC and PC/XT class)
  153. mchines only. AT class machines appear to adhere to IBM PC/AT fornat.
  154.  
  155.  10h - Floppy Drive Type
  156.  
  157.   Bits 7-4 - First Floppy Disk Drive Type
  158.    0h      No Drive
  159.    1h      360 KB 5 1/4 Drive
  160.    2h      1.2 MB 5 1/4 Drive - note: not listed in PS/2 technical manual
  161.    3h      720 KB 3 1/2 Drive
  162.    4h     1.44 MB 3 1/2 Drive
  163.    5h-Fh  unused
  164.  
  165.    Bits 3-0 Second Floppy Disk Drive Type (bit settings same as A)
  166.  
  167.    Hence a PC having a 5 1/4 1.2 Mb A: drive and a 1.44 Mb B: drive will
  168.    have a value of 24h in byte 10h. With a single 1.44 drive: 40h.
  169.  
  170.  11h - (IBM-PS/2) First Fixed Disk Drive Type Byte (00-FFh)
  171.  11h - (AMI) Keyboard Typematic Data 
  172.  
  173.   Bit 7 Enable Typematic (1 = On)
  174.  
  175.   Bits 6-5 Typematic Delay
  176.    00b 250 ms
  177.    01b 500 ms
  178.    10b 750 ms
  179.    11b 100 ms
  180.  
  181.   Bits 4-0 Typematic Rate
  182.    00000b - 300  01000b - 159  10000b - 75  11000b - 37
  183.    00001b - 267  01001b - 133  10001b - 67  11001b - 33
  184.    00010b - 240  01010b - 120  10010b - 60  11010b - 30
  185.    00011b - 218  01011b - 109  10011b - 55  11011b - 27
  186.    00100b - 200  01100b - 100  10100b - 50  11100b - 25
  187.    00101b - 185  01101b -  92  10101b - 46  11101b - 23
  188.    00110b - 171  01110b -  86  10110b - 43  11110b - 21
  189.    00111b - 160  01111b -  80  10111b - 40  11111b - 20
  190.  
  191.  12h - (IBM PS/2) Second Hard Disk Drive Type (00-FFh)
  192.  12h - Hard Disk Data
  193.   Bits 7-4 First Hard Disk Drive
  194.    00     No drive
  195.    01-0Eh Hard drive Type 1-14
  196.    0Fh    Hard Disk Type 16-255 (actual Hard Drive Type is in CMOS RAM 1Ah)
  197.   Bits 3-0 Second Hard Disk Drive Type (same as above)
  198.   A PC with a single type 2 (20 Mb ST-225) hard disk will have 20h in byte 12h
  199.  
  200.  13h (AMI) Advanced Setup Options
  201.   Bit 7 Mouse Enabled (1 = On)
  202.   Bit 6 Test Memory above 1 MB (1 = On)
  203.   Bit 5 Memory Test Tick Sound (1 = On)
  204.   Bit 4 Memory Parity Error Check (1 = On)
  205.   Bit 3 Press <Esc> to Disable Memory Test (1 = On)
  206.   Bit 2 User-Defined Hard Disk (1 = On)
  207.   Bit 1 Wait for <F1> Message if Error (1 = On)
  208.   Bit 0 Turn Num Lock Off at boot (1 = On)
  209.  
  210.  14h - Equipment Byte 
  211.   Bits 7-6 Number of Floppy Drives (system must have at least one)
  212.    00b     1 Drive
  213.    01b     2 Drives
  214.    10b ??? 3 Drives
  215.    11b ??? 4 Drives
  216.   Bits 5-4 Monitor Type
  217.    00b Not CGA or MDA (typ for VGA)
  218.    01b 40x25 CGA
  219.    10b 80x25 CGA
  220.    11b MDA (Monochrome)
  221.   Bit 3 Display Enabled (1 = On)
  222.   Bit 2 Keyboard Enabled (1 = On)
  223.   Bit 1 Math coprocessor Installed (1 = On)
  224.   Bit 0 Floppy Drive Installed (1 = On)
  225.  
  226.  14h - (AMSTRAD)    BYTE user RAM checksum
  227.             LSB of sum of all user bytes should be AAh
  228.  
  229.  15h - Base Memory in K, Low Byte
  230.  15h - (AMSTRAD)    WORD Enter key scancode/ASCII code
  231.             default: 1C0Dh  - emulates Return key
  232.  
  233.  16h Base Memory in K, High Byte
  234.   The value in 15h-16h should be the same as in 0:413h and that returned by 
  235.   Int 12h. A PC having 640k (280h) of conventional memory will return 80h in 
  236.   byte 15h and 02h in byte 16h.
  237.  
  238.  17h - Extended Memory in K, Low Byte
  239.  17h - (AMSTRAD)    WORD Forward delete key scancode/ASCII code
  240.             default: 2207h  - emulates ^G (bell/beep)
  241.  
  242.  18h - Extended Memory in K, High Byte (some systems will only accommodate 
  243.   15 Mb extended or 16 Mb total) Format is the same as in 15h-16h
  244.  
  245.  19h - First Extended Hard Disk Drive Type (not in original AT
  246.   specification but now nearly universally used).
  247.   0-Fh unused (would not require extension. Note: this has the effect
  248.     making type 0Fh (15d) unavailable.
  249.   10h-FFh First Extended Hard Drive Type 16d-255d
  250.  
  251. For most manufacturers the last drive type (typically either 47d or 49d)
  252. is "user defined" and parameters are stored elsewhere in the CMOS.
  253.  
  254.  19h - (AMSTRAD)    WORD Joystick fire button 1 scancode/ASCII code
  255.             default: FFFFh  - (no translation)
  256.  
  257.  1Ah - Second Extended Hard Disk Drive Type (see 19h above)
  258.  
  259.  1Bh - (AMI) First Hard Disk user defined: # of Cylinders, Low Byte
  260.  1Bh - (AMSTRAD)    WORD Joystick fire button 2 scancode/ASCII code
  261.             default: FFFFh  - (no translation)
  262.  
  263.  1Ch - (AMI) First Hard Disk user defined: # of Cylinders, High Byte
  264.  
  265.  1Dh - (AMI) First Hard Disk user defined: Number of Heads
  266.  1Dh - (AMSTRAD)    WORD mouse button 1 scancode/ASCII code
  267.             default: FFFFh  - (no translation)
  268.  
  269.  1Eh - (AMI) First Hard Disk user defined: Write Precompensation Cylinder, 
  270.        Low Byte
  271.  
  272.  1Fh - (AMI) First Hard Disk user defined: Write Precompensation Cylinder, 
  273.        High Byte
  274.  1Fh - (AMSTRAD)    WORD mouse button 2 scancode/ASCII code
  275.             default: FFFFh  - (no translation)
  276.  
  277.  20h - (AMI) First Hard Disk user defined: Control Byte (80h if # of heads 
  278.        is equal or greater than 8)
  279.  
  280.  21h - (AMI) First Hard Disk user defined: Landing Zone, Low Byte
  281.  21h - (AMSTRAD) BYTE mouse X scaling factor, default: 0Ah
  282.  
  283.  
  284.  22h - (AMI) First Hard Disk user defined: Landing Zone, High Byte
  285.  22h - (AMSTRAD) BYTE mouse Y scaling factor default: 0Ah
  286.  
  287.  
  288.  23h - (AMI) First Hard Disk user defined: # of Sectors per track
  289.  23h - (AMSTRAD) BYTE initial VDU mode and drive count  default: 20h
  290.  
  291.     bit 7:  enables extended serial flow control
  292.             (NB this is buggy)
  293.     bit 6:  set if two floppy drives installed
  294.     bits 5 & 4: (from Amstrad 1640 tech ref)
  295.          0   0      Internal video adapter
  296.          0   1      CGA card added; 40 x 25 mode
  297.          1   0      CGA card added; 80 x 25 mode
  298.          1   1      mono card added; 80 x 25 mode
  299.  
  300.  24h - (AMI) Second Hard Disk user defined: # of Cylinders, Low Byte
  301.  24h - (AMSTRAD)    BYTE initial VDU character attribute, default: 7h
  302.  
  303.  
  304.  25h - (AMI) Second Hard Disk user defined: # of Cylinders, High Byte
  305.  25h - (AMSTRAD)    BYTE size of RAM disk in 2K blocks
  306.         default: 0  - only used by the RAMDISK software supplied.
  307.  
  308.  
  309.  26h - (AMI) Second Hard Disk user defined: Number of Heads
  310.  26h - (AMSTRAD)    BYTE initial system UART setup byte
  311.             default: E3h - format as for Int 14h fn 0
  312.  
  313.  27h - (AMI) Second Hard Disk user defined: Write Precompensation Cylinder, 
  314.        Low Byte
  315.  27h - (AMSTRAD)    BYTE initial external UART setup byte
  316.             default: E3h - format as for Int 14h fn 0
  317.  
  318.  28h - (AMI) Second Hard Disk user defined: Write Precompensation Cylinder, 
  319.        High Byte
  320.  
  321.  28h-3Fh (AMSTRAD) 24 BYTEs user applications default: zeroes
  322.  
  323.  
  324.  29h - (AMI) Second Hard Disk user defined: Control Byte (80h if # of heads 
  325.        is equal or greater than 8)
  326.  
  327.  2Ah - (AMI) Second Hard Disk user defined: Landing Zone, Low Byte
  328.  
  329.  2Bh - (AMI) Second Hard Disk user defined: Landing Zone, High Byte
  330.  
  331.  2Ch - (AMI) Second Hard Disk user defined: # of Sectors per track
  332.  2Ch - (COMPAQ) bit 6:  0 - numlock OFF on boot, 1 - numlock ON at boot
  333.  
  334.  2Dh - (AMI) Configuration Options 
  335.   Bit 7 Weitek Installed(1 = On)
  336.   Bit 6 Floppy Drive Seek - turn off for fast boot
  337.   Bit 5 Boot Order 0 - Drive C:, then A:
  338.                    1 - Drive A:, then C:
  339.   Bit 4 Boot Speed (0 - Low; 1 - High)
  340.   Bit 3 External Cache Enable (1 = On)
  341.   Bit 2 Internal Cache Enable (1 = On)
  342.   Bit 1 Use Fast Gate A20 after boot (1 = On)
  343.   Bit 0 Turbo Switch (1 = On)
  344.   
  345.  2Eh - Standard CMOS Checksum, High Byte
  346.  2Fh - Standard CMOS Checksum, Low Byte
  347.  
  348.  2Eh and 2Fh are as defined by the original IBM PC/AT specification and
  349.  represent a byte-wise additive sum of the values in locations 10h-2Dh only,
  350.  00h-0Fh and 30h-33h are not included. This definition is used by most
  351.  clone manufacturers including AMI, Compaq, Tandon, NEC, and Zenith. The 
  352.  IBM PS/2 line does not follow this standard with the range 19h-31h being 
  353.  undefined.
  354.  
  355.  30h - Extended Memory in K, Low Byte
  356.  
  357.  31h - Extended Memory in K, High Byte 
  358.  (??? this appears to mirror the value in bytes 17h-18h.) 
  359.  
  360.  32h - Century Byte (BCD value for the century - currently 19)
  361.  32h - (IBM-PS2) Configuration CRC low byte. CRC for range 10h-31h
  362.  
  363.  33h - Information Flag
  364.   Bit 7 128K (??? believe this indicates the presence of the special 128k
  365.               memory expansion board for the AT to boost the "stock" 512k
  366.               to 640k - all machines surveyed have this bit set)
  367.   Bits 6-0 ???
  368.  33h - (IBM PS/2) Configuration CRC high byte (see entry for 32h)
  369.  
  370.  34h - (AMI) Shadowing & Boot Password
  371.   Bits 7-6 Password
  372.    00b Disable 10b Reserved
  373.    01b Set     11b Boot
  374.   Bit 5 C8000h Shadow ROM (Bit 1 = On) 
  375.   Bit 4 CC000h Shadow ROM (Bit 1 = On)
  376.   Bit 3 D0000h Shadow ROM (Bit 1 = On)
  377.   Bit 2 D4000h Shadow ROM (Bit 1 = On)
  378.   Bit 1 D8000h Shadow ROM (Bit 1 = On)
  379.   Bit 0 DC000h Shadow ROM (Bit 1 = On)
  380.  
  381.  35h - (AMI) Shadowing
  382.   Bit 7 E0000h Shadow ROM (Bit 1 = On)
  383.   Bit 6 E4000h Shadow ROM (Bit 1 = On)
  384.   Bit 5 E8000h Shadow ROM (Bit 1 = On)
  385.   Bit 4 EC000h Shadow ROM (Bit 1 = On)
  386.   Bit 3 F0000h Shadow ROM (Bit 1 = On)
  387.   Bit 2 C0000h Shadow ROM (Bit 1 = On)
  388.   Bit 1 C4000h Shadow ROM (Bit 1 = On)
  389.   Bit 0 Reserved
  390.  
  391.  36h ???
  392.  
  393.  37h - (IBM PS/2) Date Century Byte 
  394.  
  395.  38h-3Dh (AMI) Encrypted Password
  396.  
  397.  38h-3Fh ??? (IBM PS/2) Encrypted Password. Initialized to 00h in all
  398.      bytes. Will accept from 1-7 scan codes. 
  399.  
  400.  3Eh - (AMI) Extended CMOS Checksum, High Byte (includes 34h - 3Dh)
  401.  3Fh - (AMI) Extended CMOS Checksum, Low Byte (includes 34h - 3Dh)
  402.  
  403.  End of original 64 CMOS RAM bytes. Many modern chips now contain 128
  404.  bytes and the IBM PS/2 has provision for 2k of "Expansion CMOS". 
  405.  The AMI HI-FLEX description is below. If the chip does have only
  406.  64 bytes, addresses will wrap so that requests for bytes 40h-7Fh will 
  407.  return the same values as 00h-3Fh.
  408.  
  409.  40h ???
  410.  
  411.  41h - (AMI)
  412.   Bits 7-6 IOR/IOW Wait states
  413.   Bits 5-4 16-bit DMA Wait States
  414.   Bits 3-2  8-bit DMA Wait States
  415.   Bit 1    EMR bit
  416.   Bit 0    DMA Clock Source
  417.  
  418.  42h-43h ???
  419.  
  420.  44h - (AMI)
  421.   Bit 4 NMI Power Fail Warning
  422.   Bit 3 NMI Local Bus Timeout
  423.  
  424.  45h - (AMI) 
  425.   Bits 7-6 AT Bus 32-Bit Delay
  426.   Bits 5-4 AT Bus 16-Bit Delay
  427.   Bits 3-2 AT Bus 8-Bit Delay
  428.   Bits 1-0 AT Bus I/O Delay
  429.  
  430.  46h - (AMI)
  431.   Bits 7-6 AT Bus 32 Bit Wait States
  432.   Bits 5-4 AT Bus 16 Bit Wait States
  433.   Bits 3-2 AT Bus  8 Bit Wait States
  434.   Bits 1-0 AT Bus Clock Source
  435.  
  436.  47h - 50h ???
  437.  
  438.  51h - (AMI)
  439.   Bit 7    Bank 0/1 RAS Precharge
  440.   Bit 6    Bank 0/1 Access Wait States
  441.   Bits 3-2 Bank 0/1 Wait States
  442.  
  443.  52h ???
  444.  
  445.  53h - (AMI)
  446.   Bit 7    Bank 2/3 RAS Precharge
  447.   Bit 6    Bank 2/3 Access Wait States
  448.   Bits 3-2 Bank 2/3 Wait States
  449.  
  450.  54h-7Fh ???
  451.  
  452.  
  453. Revision History
  454. v1.15   June, 1993      AMSTRAD data updated
  455. v1.1     June, 1993    AMSTRAD & PS/2 data added 
  456. v1.0    June, 1993    First release
  457.  
  458.